<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 25%;
            border: 1px solid red;
            /* 宽高比是16：9 */
        }
        .bl16-9{
            /* 用百分比表示 padding-top 160 * 10% = 16px */
            padding-top: calc(9 / 16 * 100%);
            background-color: khaki;
            position: relative;
        }
        .content{
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            background-color: skyblue;
        }
        .content img{
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="bl16-9">
            <div class="content">
                <img src="images/02-3.jpg" alt="">
                <p>我是一张图片</p>
            </div>
        </div>
    </div>
</body>
</html>